<template>
  <el-container>
    <el-header style="text-align: left; font-size: 26px">
      <span><b>理财产品列表</b></span>
    </el-header>

    <el-main>
      <el-table :data="tableData" stripe @row-click="changeDetails">
        <el-table-column prop="id" label="序号"></el-table-column>
        <el-table-column prop="goodsName" label="产品名称"></el-table-column>
        <el-table-column prop="aagr" label="年化收益"> </el-table-column>
        <el-table-column prop="term" label="投资周期"> </el-table-column>
        <el-table-column prop="goodsPrice" label="起投金额"> </el-table-column>
        <el-table-column prop="operate" label="操作">
          <el-link><i class="el-icon-view el-icon--left"></i>详情</el-link>
        </el-table-column>
      </el-table>
    </el-main>
  </el-container>
</template>

<script>
export default {
  name: "ProductList",
  data() {
    return {
      tableData: null,
    };
  },
  created() {
    this.getLists();
  },
  methods: {
    changeDetails(row) {
      this.$router.push({
        path: 'ProductDetails',
        query:{
          row:row.id
        }
      });
    },
    getLists() {
      this.$http({
        method: "get",
        url: "/mall/goods/list?limit=0&to=30",
      }).then((resp) => {
        this.tableData = resp.data;
      });
    },
  },
};
</script>

<style>
</style>